/**
 * 
 */
package com.thor.palmmall.rest.communicate.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.commons.entity.UCN;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class UCNConverter implements Converter<UCN, UCN> {

  public static UCNConverter getInstance() {
    if (instance == null)
      instance = new UCNConverter();
    return instance;
  }

  private static UCNConverter instance;

  private UCNConverter() {
  }

  @Override
  public UCN convert(UCN source) {
    if (source == null) {
      return null;
    }
    UCN target = new UCN();
    target.setCode(source.getCode());
    target.setName(source.getName());
    target.setUuid(source.getUuid());
    return target;
  }

}
